package cn.edu.nciae.libindex.entity;

import lombok.*;
import org.elasticsearch.index.settings.IndexDynamicSettings;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;

import java.io.Serializable;
import java.math.BigDecimal;


/**
 * Book Entity
 *
 * @author suddev
 * @create 2018-03-31 下午12:59
 **/
@Document(indexName = "books",type = "library")
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
//@Entity
//@Table(name = "books",indexes = {
//        @Index(name = "idx_book_name",unique = false,columnList = "bookName")})

public class Book implements Serializable {

    @Id
    private String id;

    @Field(analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String bookName;

    private String press;

    private String isbn;

    private BigDecimal price;

    private String parallelTitle;

    private String firstAuthor;

    private String secondAuthor;

    private String subject;

    private String cnNo;

    private String content;

}
